<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $title; ?></title>
<base href="<?php echo $base; ?>" />
<?php if ($description) { ?>
<meta name="description" content="<?php echo $description; ?>" />
<?php } ?>
<?php if ($keywords) { ?>
<meta name="keywords" content="<?php echo $keywords; ?>" />
<?php } ?>
<?php foreach ($this->document->getOpenGraph() as $property => $content) { ?>
<meta property="<?php echo $property ?>" content="<?php echo $content; ?>" />
<?php } ?>
<?php if ($icon) { ?>
<link href="<?php echo $icon; ?>" rel="icon" />
<?php } ?>
<?php foreach ($links as $link) { ?>
<link href="<?php echo $link['href']; ?>" rel="<?php echo $link['rel']; ?>" />
<?php } ?>
<link rel="stylesheet" type="text/css" href="themes/default/stylesheet/stylesheet.css" />
<?php foreach ($styles as $style) { ?>
<link rel="<?php echo $style['rel']; ?>" type="text/css" href="<?php echo $style['href']; ?>" media="<?php echo $style['media']; ?>" />
<?php } ?>
<script type="text/javascript" src="static/javascript/jquery/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="static/javascript/jquery/ui/jquery-ui-1.8.16.custom.min.js"></script>
<link rel="stylesheet" type="text/css" href="static/javascript/jquery/ui/themes/ui-lightness/jquery-ui-1.8.16.custom.css" />
<script type="text/javascript" src="static/javascript/jquery/ui/external/jquery.cookie.js"></script>
<script type="text/javascript" src="static/javascript/jquery/colorbox/jquery.colorbox.js"></script>
<link rel="stylesheet" type="text/css" href="static/javascript/jquery/colorbox/colorbox.css" media="screen" />
<script type="text/javascript" src="static/javascript/jquery/tabs.js"></script>
<script type="text/javascript" src="themes/javascript/common.js"></script>
<?php foreach ($scripts as $script) { ?>
<script type="text/javascript" src="<?php echo $script; ?>"></script>
<?php } ?>
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="themes/default/stylesheet/ie7.css" />
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="themes/default/stylesheet/ie6.css" />
<script type="text/javascript" src="static/javascript/DD_belatedPNG_0.0.8a-min.js"></script>
<script type="text/javascript">
DD_belatedPNG.fix('#logo img');
</script>
<![endif]-->
</head>
<body>
<div id="container">
<div id="header">
  <?php if (C('config_logo')) { ?>
  <div id="logo"><a href="<?php echo $home; ?>">
  	<img src="<?php echo image_url(C('config_logo')); ?>" title="<?php echo C('config_name'); ?>" alt="<?php echo C('config_name'); ?>" />
  </a></div>
  <?php } ?>
  <?php echo $language; ?>
  <?php echo $currency; ?>
  <?php echo $cart; ?>
  <div id="search">
    <div class="button-search"></div>
    <?php if ($search) { ?>
    <input type="text" name="search" value="<?php echo $search; ?>" />
    <?php } else { ?>
    <input type="text" name="search" value="<?php echo $_['text_search']; ?>" onclick="this.value = '';" onkeydown="this.style.color = '#000000';" />
    <?php } ?>
  </div>
  <div id="welcome">
    <?php if (!$logged) { ?>
    <?php echo $text_welcome; ?>
    <?php } else { ?>
    <?php echo $text_logged; ?>
    <?php } ?>
  </div>
  <div class="links">
  <a href="<?php echo $home; ?>"><?php echo $_['text_home']; ?></a>
  <a href="<?php echo US('account/wishlist'); ?>" id="wishlist-total"><?php echo $text_wishlist; ?></a>
  <a href="<?php echo US('account/account') ?>"><?php echo $_['text_account']; ?></a>
  <a href="<?php echo U('checkout/cart'); ?>"><?php echo $_['text_shopping_cart']; ?></a>
  <a href="<?php echo US('checkout/checkout'); ?>"><?php echo $_['text_checkout']; ?></a>
  </div>
</div>
<?php if ($categories) { ?>
<div id="menu">
  <ul>
    <?php foreach ($categories['p'] as $category_id) { ?>
    <?php if (!$categories[$category_id]['top']) continue;?>
    <li><a href="<?php echo $categories[$category_id]['link']; ?>"><?php echo $categories[$category_id]['name']; ?></a>
      <?php if (isset($categories[$category_id]['sub'])) { ?>
      <div>
		<ul>
        <?php 
		$subs = explode(',', $categories[$category_id]['sub']);
		if ($categories[$category_id]['column'] > 0)
			$j = ceil(count($subs) / $categories[$category_id]['column']);
		else
			$j = count($subs);
		foreach($subs as $i => $sub) {
		?>
		<?php if ($i > 0 && $i % $j == 0) { ?>
		</ul><ul>
		<?php } ?>
		<li><a href="<?php echo $categories[$sub]['link']; ?>"><?php echo $categories[$sub]['name'] . (C('config_product_count') ? ' (' . $categories[$sub]['total'] . ')' : ''); ?></a></li>
		<?php
		}
		?>
		</ul>
      </div>
      <?php } ?>
    </li>
    <?php } ?>
  </ul>
</div>
<?php } ?>
<div id="notification"></div>
